package tengxun;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Main4 {

    public static void main(String[] args) throws Exception{
        BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
        String s = buf.readLine();
        String[] ss;
        int T = Integer.parseInt(s);
        for (int t = 0; t < T; t++){
            s = buf.readLine();
            ss = s.split(" ");
            int n = Integer.parseInt(ss[0]);
            int w = Integer.parseInt(ss[1]);
            List<Integer> odd = new ArrayList<>();
            List<Integer> even = new ArrayList<>();
            int n1, n2, n3, n4;
            s = buf.readLine();
            ss = s.split(" ");
            int[] arr = new int[n];
            for (int i = 0; i < n; i++){
                arr[i] = Integer.parseInt(ss[i]);
            }
            for (int i = 0; i < n; i++){
                if (arr[i] % 2 == 0){
                    even.add(arr[i]);
                } else {
                    odd.add(arr[i]);
                }
            }
            int res = 0;
            Collections.sort(even);
            Collections.sort(odd);
            int m = odd.size();
            int i=0,j=m-1;
            while ( i < j){
                if (odd.get(i) + odd.get(j) <= w){
                    res++;i++;j--;
                } else if (odd.get(j) <= w){
                    res++;j--;
                } else {
                    j--;
                }
            }
            if(i==j&&odd.get(i)<=w){
                res++;
            }
            m = even.size();
            i=0;
            j=m-1;
            while(i<j){
                if(even.get(i)+even.get(j)<=w){
                    res++;
                    i++;j--;
                }
                else if(even.get(j)<=w){
                    res++;
                    j--;
                }
                else
                    j--;
            }
            if(i==j&&even.get(i)<=w){
                res++;
            }
            System.out.println(res);

        }
    }
}